package com.kede.app.domain;

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @description /
* @author Pr.li
* @date 2023-05-27
**/
@Entity
@Data
@Table(name="sy_leescore_category")
public class LeescoreCategory implements Serializable {
    /**
    * 分类ID
    */
    @ApiModelProperty(value = "分类ID")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    private Integer id;
    /**
    * 菜单名
    */
    @ApiModelProperty(value = "菜单名")
    @Column(name = "`name`")
    private String name;
    /**
    * 顶级父类ID
    */
    @ApiModelProperty(value = "顶级父类ID")
    @Column(name = "`topid`")
    private Integer topid;
    /**
    * 上级菜单
    */
    @ApiModelProperty(value = "上级菜单")
    @Column(name = "`category_id`")
    private Integer categoryId;
    /**
    * 完整路径
    */
    @ApiModelProperty(value = "完整路径")
    @Column(name = "`path`")
    private String path;
    /**
    * 权重排序
    */
    @ApiModelProperty(value = "权重排序")
    @Column(name = "`weigh`")
    private Integer weigh;
    /**
    * 状态
    */
    @ApiModelProperty(value = "状态")
    @Column(name = "`status`")
    private String status;
    /**
    * 创建时间
    */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "`createtime`")
    private Integer createtime;

    public void copy(LeescoreCategory source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
